package com.chinaunicom.member.domain.model.entity;

import com.chinaunicom.common.util.MD5;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author guomenghuai
 * @date 2024/1/8
 * @Description
 */
@Data
public class UserEntity {

    private Long userId;

    private String username;

    private String password;

    private String mobile;

    private String openId;

    private String headImg;

    public void checkPassword(String password) {
        if (!StringUtils.equals(this.password, MD5.md5(password))) {
            throw new RuntimeException("用户名或密码不正确");
        }
    }
}
